<template>
  <transition name="fade">
    <div class="kiko-message" v-if="isShow">
      <img class="kiko-img" src="./assets/yes.png"/>
        <p style="text-align: center">{{message}}</p>
    </div>
  </transition>
</template>

<script type="text/javascript">
  export default {
    name: 'alertTip',
    data () {
      return {
        message: '',
        time: 3000,
        isShow: true
      }
    },
    mounted () {
      this.close()
    },
    methods: {
      close () {
        var that = this
        window.setTimeout(function() {
          that.isShow = false
        }, this.time);
      }
    }
  }
</script>

<style type="text/css">
  .kiko-message {
    position: fixed;
    color: #fff;
    width: 250px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #5F6161;
    border-radius: 8px;
    top:50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999999999;
    font-size: 26px;
  }
  .kiko-img {
    width: 40px;
    height: 40px;
    margin: 20px 0; 
  }
  .fade-enter-active, .fade-leave-active {
    transition: opacity .5s
  }
  .fade-enter, .fade-leave-to /* .fade-leave-active in below version 2.1.8 */ {
    opacity: 0
  }
</style>
